;;; $Id: repl.sld 405 2014-03-06 04:33:08Z alan.watson.f $

(define-library (oaxaca repl)

  (export repl
          interaction-environment)

  (import (scheme base)
          (scheme eval))

  (cond-expand (chibi (import (oaxaca repl-chibi))))

  (begin

    (define (repl)
      (repl-helper (interaction-environment)))

    ;; The interaction-environment procedure defined here mirrors the
    ;; one in the (scheme repl) library, but is more suitable for
    ;; Oaxaca. See also the (oaxaca load) library.

    (define the-interaction-environment #f)

    (define (interaction-environment)
      (unless the-interaction-environment
        (set! the-interaction-environment
              (environment '(scheme base)
                           '(scheme case-lambda)
                           '(scheme char)
                           '(scheme complex)
                           '(scheme division)
                           '(scheme eval)
                           '(scheme inexact)
                           '(scheme lazy)
                           '(scheme process-context)
                           '(scheme read)
                           '(scheme repl)
                           '(scheme time)
                           '(scheme write)
                           '(oaxaca ao)
                           '(oaxaca console)
                           '(oaxaca file)
                           '(oaxaca finder)
                           '(oaxaca housekeeping)
                           '(oaxaca instrument)
                           '(oaxaca lamp)
                           '(oaxaca load)
                           '(oaxaca log)
                           '(oaxaca repl)
                           '(oaxaca telescope)
                           '(oaxaca thread)
                           '(oaxaca wfc)
                           '(oaxaca wfs))))
      the-interaction-environment)))
